import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

//重写方法解决跳转到同一路由报错问题
const myReplace = router.replace;
router.replace = function replace(location) {
  return myReplace.call(this,location).catch(err=>err);
};
const myPush = router.push;
router.push = function push(location) {
  return myPush.call(this,location).catch(err=>err);
};


//引入ElementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

//引入Axios
import axios from 'axios'
//Vue.prototype.xxx  给Vue添加一个全局的变量
// 添加的全局变量可以在任意的*.vue文件中通过this.xxx访问
Vue.prototype.axios=axios

//导入qs框架
import qs from 'qs'
Vue.prototype.qs=qs;

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
